﻿using System;
using System.Windows.Media;

namespace RPGOnlineWPF.Extensions
{
	public static class ColorExtension
	{
		public static Color ToWpfColor(this System.Drawing.Color color)
		{
			return Color.FromArgb(color.A, color.R, color.G, color.B);
		}

		public static int Brightness(this System.Drawing.Color color)
		{			
			return (int)Math.Sqrt(
				color.R * color.R * .241 + 
				color.G * color.G * .691 + 
				color.B * color.B * .068
			);
		}
	}
}